using System.Data.OleDb;
using Chaotic.DataBase.DataAccess; 

namespace Chaotic.DataBase.OLEDBAccess;

public class DbTypeEnum : IDbTypeEnum
{
	public int GetTypeEnum(string? dbType)
	{
		return dbType.Trim().ToUpper() switch
		{
			"BIT" => OleDbType.BigInt.GetHashCode(), 
			"BINARY" => OleDbType.Binary.GetHashCode(), 
			"BIGINT" => OleDbType.BigInt.GetHashCode(), 
			"CHAR" => OleDbType.Char.GetHashCode(), 
			"DATETIME" => OleDbType.DBTimeStamp.GetHashCode(), 
			"DECIMAL" => OleDbType.Decimal.GetHashCode(), 
			"FLOAT" => OleDbType.Double.GetHashCode(), 
			"INT" => OleDbType.Integer.GetHashCode(), 
			"MONEY" => OleDbType.Decimal.GetHashCode(), 
			"TEXT" => OleDbType.LongVarChar.GetHashCode(), 
			"TIMESTAMP" => OleDbType.DBTimeStamp.GetHashCode(), 
			"VARCHAR" => OleDbType.VarChar.GetHashCode(), 
			_ => 0, 
		};
	}
}
